﻿using System;
using Microsoft.WowAddonStudio.Project.Import.Ace;
using Microsoft.WowAddonStudio.Project.Import.Folder;
using Microsoft.WowAddonStudio.Project;

namespace Microsoft.WowAddonStudio.Project.Import
{
	/// <summary>
	/// Creates instances of <see cref="IImportPlugin"/>
	/// </summary>
	internal static class ImportPluginFactory
	{
		/// <summary>
		/// Creates instances of <see cref="IImportPlugin"/> based on selected
		/// import type.
		/// </summary>
		/// <param name="type">Type of import</param>
		/// <returns>Plugin that handles the given type of import.</returns>
		internal static IImportPlugin CreateImportPlugin(ImportType type)
		{
			switch (type)
			{
				case ImportType.FolderImport:
					return new FolderImportPlugin();
				case ImportType.AceImport:
					return new AceImportPlugin();
				default:
					throw new ArgumentException(String.Format(Resources.GetString("ImportPluginErrorMessage"), type));
			}
		}
	}
}